package com.tengju.data.domain.shared;

import java.util.Arrays;

/**
 * @author: 李大仙
 * @date: 2021/5/21 5:38 下午
 */
public enum OrderTypeEnum {

    ASC("ASC"),

    DESC("DESC");

    private String orderType;

    public String getOrderType() {
        return orderType;
    }

    OrderTypeEnum(String orderType) {
        this.orderType = orderType;
    }

    public static OrderTypeEnum form(String orderType) {
        return Arrays.stream(OrderTypeEnum.values())
                .filter(k -> k.getOrderType().equalsIgnoreCase(orderType))
                .findFirst().orElse(null);
    }
}
